3.3 \(\int \frac{(a+b x) (c+d x)}{(e+f x) (g+h x)} \, dx\)

Optimal. Leaf size=84 \[ \frac{(b e-a f) (d e-c f) \log (e+f x)}{f^2 (f g-e h)}-\frac{(b g-a h) (d g-c h) \log (g+h x)}{h^2 (f g-e h)}+\frac{b d x}{f h} \]

[Out]

(b*d*x)/(f*h) + ((b*e - a*f)*(d*e - c*f)*Log[e + f*x])/(f^2*(f*g - e*h)) - ((b*g
 - a*h)*(d*g - c*h)*Log[g + h*x])/(h^2*(f*g - e*h))

_______________________________________________________________________________________

Rubi [A]  time = 0.229753, antiderivative size = 84, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 1, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.04 \[ \frac{(b e-a f) (d e-c f) \log (e+f x)}{f^2 (f g-e h)}-\frac{(b g-a h) (d g-c h) \log (g+h x)}{h^2 (f g-e h)}+\frac{b d x}{f h} \]

Antiderivative was successfully verified.

[In]  Int[((a + b*x)*(c + d*x))/((e + f*x)*(g + h*x)),x]

[Out]

(b*d*x)/(f*h) + ((b*e - a*f)*(d*e - c*f)*Log[e + f*x])/(f^2*(f*g - e*h)) - ((b*g
 - a*h)*(d*g - c*h)*Log[g + h*x])/(h^2*(f*g - e*h))

_______________________________________________________________________________________

Rubi in Sympy [F]  time = 0., size = 0, normalized size = 0. \[ \frac{d \int b\, dx}{f h} + \frac{\left (a h - b g\right ) \left (c h - d g\right ) \log{\left (g + h x \right )}}{h^{2} \left (e h - f g\right )} - \frac{\left (a f - b e\right ) \left (c f - d e\right ) \log{\left (e + f x \right )}}{f^{2} \left (e h - f g\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((b*x+a)*(d*x+c)/(f*x+e)/(h*x+g),x)

[Out]

d*Integral(b, x)/(f*h) + (a*h - b*g)*(c*h - d*g)*log(g + h*x)/(h**2*(e*h - f*g))
 - (a*f - b*e)*(c*f - d*e)*log(e + f*x)/(f**2*(e*h - f*g))

_______________________________________________________________________________________

Mathematica [A]  time = 0.12571, size = 85, normalized size = 1.01 \[ \frac{f (b d h x (f g-e h)-f (b g-a h) (d g-c h) \log (g+h x))+h^2 (b e-a f) (d e-c f) \log (e+f x)}{f^2 h^2 (f g-e h)} \]

Antiderivative was successfully verified.

[In]  Integrate[((a + b*x)*(c + d*x))/((e + f*x)*(g + h*x)),x]

[Out]

((b*e - a*f)*(d*e - c*f)*h^2*Log[e + f*x] + f*(b*d*h*(f*g - e*h)*x - f*(b*g - a*
h)*(d*g - c*h)*Log[g + h*x]))/(f^2*h^2*(f*g - e*h))

_______________________________________________________________________________________

Maple [B]  time = 0.026, size = 196, normalized size = 2.3 \[{\frac{bdx}{fh}}-{\frac{\ln \left ( fx+e \right ) ac}{eh-fg}}+{\frac{\ln \left ( fx+e \right ) ade}{f \left ( eh-fg \right ) }}+{\frac{\ln \left ( fx+e \right ) bce}{f \left ( eh-fg \right ) }}-{\frac{\ln \left ( fx+e \right ) bd{e}^{2}}{{f}^{2} \left ( eh-fg \right ) }}+{\frac{\ln \left ( hx+g \right ) ac}{eh-fg}}-{\frac{\ln \left ( hx+g \right ) adg}{h \left ( eh-fg \right ) }}-{\frac{\ln \left ( hx+g \right ) bcg}{h \left ( eh-fg \right ) }}+{\frac{\ln \left ( hx+g \right ) bd{g}^{2}}{{h}^{2} \left ( eh-fg \right ) }} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((b*x+a)*(d*x+c)/(f*x+e)/(h*x+g),x)

[Out]

b*d*x/f/h-1/(e*h-f*g)*ln(f*x+e)*a*c+1/f/(e*h-f*g)*ln(f*x+e)*a*d*e+1/f/(e*h-f*g)*
ln(f*x+e)*b*c*e-1/f^2/(e*h-f*g)*ln(f*x+e)*b*d*e^2+1/(e*h-f*g)*ln(h*x+g)*a*c-1/h/
(e*h-f*g)*ln(h*x+g)*a*d*g-1/h/(e*h-f*g)*ln(h*x+g)*b*c*g+1/h^2/(e*h-f*g)*ln(h*x+g
)*b*d*g^2

_______________________________________________________________________________________

Maxima [A]  time = 1.36509, size = 140, normalized size = 1.67 \[ \frac{b d x}{f h} + \frac{{\left (b d e^{2} + a c f^{2} -{\left (b c + a d\right )} e f\right )} \log \left (f x + e\right )}{f^{3} g - e f^{2} h} - \frac{{\left (b d g^{2} + a c h^{2} -{\left (b c + a d\right )} g h\right )} \log \left (h x + g\right )}{f g h^{2} - e h^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((b*x + a)*(d*x + c)/((f*x + e)*(h*x + g)),x, algorithm="maxima")

[Out]

b*d*x/(f*h) + (b*d*e^2 + a*c*f^2 - (b*c + a*d)*e*f)*log(f*x + e)/(f^3*g - e*f^2*
h) - (b*d*g^2 + a*c*h^2 - (b*c + a*d)*g*h)*log(h*x + g)/(f*g*h^2 - e*h^3)

_______________________________________________________________________________________

Fricas [A]  time = 0.250257, size = 158, normalized size = 1.88 \[ \frac{{\left (b d e^{2} + a c f^{2} -{\left (b c + a d\right )} e f\right )} h^{2} \log \left (f x + e\right ) +{\left (b d f^{2} g h - b d e f h^{2}\right )} x -{\left (b d f^{2} g^{2} + a c f^{2} h^{2} -{\left (b c + a d\right )} f^{2} g h\right )} \log \left (h x + g\right )}{f^{3} g h^{2} - e f^{2} h^{3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((b*x + a)*(d*x + c)/((f*x + e)*(h*x + g)),x, algorithm="fricas")

[Out]

((b*d*e^2 + a*c*f^2 - (b*c + a*d)*e*f)*h^2*log(f*x + e) + (b*d*f^2*g*h - b*d*e*f
*h^2)*x - (b*d*f^2*g^2 + a*c*f^2*h^2 - (b*c + a*d)*f^2*g*h)*log(h*x + g))/(f^3*g
*h^2 - e*f^2*h^3)

_______________________________________________________________________________________

Sympy [A]  time = 33.2807, size = 507, normalized size = 6.04 \[ \frac{b d x}{f h} + \frac{\left (a h - b g\right ) \left (c h - d g\right ) \log{\left (x + \frac{a c e f h^{2} + a c f^{2} g h - 2 a d e f g h - 2 b c e f g h + b d e^{2} g h + b d e f g^{2} - \frac{e^{2} f h \left (a h - b g\right ) \left (c h - d g\right )}{e h - f g} + \frac{2 e f^{2} g \left (a h - b g\right ) \left (c h - d g\right )}{e h - f g} - \frac{f^{3} g^{2} \left (a h - b g\right ) \left (c h - d g\right )}{h \left (e h - f g\right )}}{2 a c f^{2} h^{2} - a d e f h^{2} - a d f^{2} g h - b c e f h^{2} - b c f^{2} g h + b d e^{2} h^{2} + b d f^{2} g^{2}} \right )}}{h^{2} \left (e h - f g\right )} - \frac{\left (a f - b e\right ) \left (c f - d e\right ) \log{\left (x + \frac{a c e f h^{2} + a c f^{2} g h - 2 a d e f g h - 2 b c e f g h + b d e^{2} g h + b d e f g^{2} + \frac{e^{2} h^{3} \left (a f - b e\right ) \left (c f - d e\right )}{f \left (e h - f g\right )} - \frac{2 e g h^{2} \left (a f - b e\right ) \left (c f - d e\right )}{e h - f g} + \frac{f g^{2} h \left (a f - b e\right ) \left (c f - d e\right )}{e h - f g}}{2 a c f^{2} h^{2} - a d e f h^{2} - a d f^{2} g h - b c e f h^{2} - b c f^{2} g h + b d e^{2} h^{2} + b d f^{2} g^{2}} \right )}}{f^{2} \left (e h - f g\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((b*x+a)*(d*x+c)/(f*x+e)/(h*x+g),x)

[Out]

b*d*x/(f*h) + (a*h - b*g)*(c*h - d*g)*log(x + (a*c*e*f*h**2 + a*c*f**2*g*h - 2*a
*d*e*f*g*h - 2*b*c*e*f*g*h + b*d*e**2*g*h + b*d*e*f*g**2 - e**2*f*h*(a*h - b*g)*
(c*h - d*g)/(e*h - f*g) + 2*e*f**2*g*(a*h - b*g)*(c*h - d*g)/(e*h - f*g) - f**3*
g**2*(a*h - b*g)*(c*h - d*g)/(h*(e*h - f*g)))/(2*a*c*f**2*h**2 - a*d*e*f*h**2 -
a*d*f**2*g*h - b*c*e*f*h**2 - b*c*f**2*g*h + b*d*e**2*h**2 + b*d*f**2*g**2))/(h*
*2*(e*h - f*g)) - (a*f - b*e)*(c*f - d*e)*log(x + (a*c*e*f*h**2 + a*c*f**2*g*h -
 2*a*d*e*f*g*h - 2*b*c*e*f*g*h + b*d*e**2*g*h + b*d*e*f*g**2 + e**2*h**3*(a*f -
b*e)*(c*f - d*e)/(f*(e*h - f*g)) - 2*e*g*h**2*(a*f - b*e)*(c*f - d*e)/(e*h - f*g
) + f*g**2*h*(a*f - b*e)*(c*f - d*e)/(e*h - f*g))/(2*a*c*f**2*h**2 - a*d*e*f*h**
2 - a*d*f**2*g*h - b*c*e*f*h**2 - b*c*f**2*g*h + b*d*e**2*h**2 + b*d*f**2*g**2))
/(f**2*(e*h - f*g))

_______________________________________________________________________________________

GIAC/XCAS [F(-2)]  time = 0., size = 0, normalized size = 0. \[ \text{Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((b*x + a)*(d*x + c)/((f*x + e)*(h*x + g)),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError